#ifndef SEGMENTATION_H
#define SEGMENTATION_H

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>

//#include "cvskincolorcbcr.h"
//#include "cvskincolorpeer.h"

/*Retirado do codigo da Ana/Fernando*/
#define MAX3(R1, R2, R3) ((R1 > R2) ? (R1 > R3) ? R1 : R3 : (R2 > R3) ? R2 : R3)

typedef struct SkinRangeParam {
    int h_max  ,s_max;
    int h_min , s_min; 
}skinRangeParam;


skinRangeParam initializeGlobal ();
void applyDilateErode (IplImage *image,int e1, int d1, int e2);
void updateSkinRange(IplImage *image, IplImage *image_bin, skinRangeParam skinRange) ;
void computeHistogramProfiles(IplImage *image_bin, int *horizontal, int *vertical, int vmax, int hmax) ;
void findIntersectionPoints(int *horizontal, int tam_horizontal, int *vertical, int tam_vertical,CvPoint *points);
void choosePoints (IplImage *image_bin,CvPoint *points, CvPoint *points_chosen) ;
CvRect calculateBox (IplImage *image, CvPoint centroid);

#endif